package com.cjm.nio.demo;

import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;

public class NioTask {
    private SocketChannel clientChannel;
    private int selectionKey;
    private ByteBuffer byteBuffer;
    public NioTask(SocketChannel clientChannel, int selectionKey) {
        this.clientChannel = clientChannel;
        this.selectionKey = selectionKey;
    }

    public NioTask(SocketChannel sc, int opWrite, ByteBuffer reqBuffer) {
        this.clientChannel = sc;
        this.selectionKey = opWrite;
        this.byteBuffer = reqBuffer;
    }

    public SocketChannel getSc() {
        return clientChannel;
    }

    public ByteBuffer getData() {
        return byteBuffer;
    }

    public int getOp() {
        return selectionKey;
    }

    public Object getAttachment() {
        return null;
    }
}
